﻿<!doctype html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,minimum-scale=1.0,user-scalable=no">
    <title>支付</title>
    <link href="Style/Common.css" rel="stylesheet">
    <link href="Style/Employ.css" rel="stylesheet">
    <link href="Style/Order.css" rel="stylesheet">
    <script src="Js/jquery.min.js" type="text/javascript"></script>
    <script src="Js/Banner.js" type="text/javascript"></script>
</head>
<body>
    <div class="Header">
        <p>
            支付</p>
        <span onclick="history.go(-1)">
            <img src="Images/Return.png"></span>
    </div>
    <!--Header end-->
    <div class="TaskInfoDes" style="border: none">
        <p class="TaskPrice" id="infoTitle">
            </p>
        <p class="TaskTime">
            <span style="background: url(Images/TaskIco.png) left -116px no-repeat" class="Sizing"
                id="infoCate">招工意向：</span> <span style="background: url(Images/TaskIco.png) left -236px no-repeat"
                    class="Sizing" id="infoDays">工期：</span> <span class="Sizing TaskPubTime" id="infoStartTime">
                        起止日期：</span>
        </p>
    </div>
    <!--TaskInfoDes end-->
    <p class="ChooseTitle">
        <span>选择工人</span></p>
    <ul class="ChooseList" id="workUl">
    </ul>
    <!--ChooseList end-->
    <ul class="SumPrice">
        <li style="color: #f00">总价格<b id="sumPriceB">￥元</b></li>
        <li style="color: #00c900">应&nbsp;&nbsp;&nbsp;&nbsp;付<b id="payPriceB">￥元</b></li>
    </ul>
    <!--SumPrice end-->
    <p class="ChooseTitle">
        <span style="background: none; padding: 0">支付方式</span></p>
    <ul class="PayWay">
        <li onclick="selectPayMethod('zfb')">
            <img src="Images/Alipay.png">
            <span class="Sizing">支付宝支付</span>
            <input id="input_zfb" class="Chosen" type="button">
        </li>
         <li onclick="selectPayMethod('ye')">
            <img src="Images/Account.png">
            <span class="Sizing">余额支付(￥<font id="font_ye">0</font>元)</span>
            <input id="input_ye" class="Chosen2" type="button" >
            
        </li>
    </ul>
    <!--PayWay end-->
    <input type="button" class="SubmitBtn" value="确认支付" onclick="toPay()">
    <div class="MenuBar" id="menuDiv">
    </div>
    <!--MenuBar end-->
</body>
</html>
<script src="Js/common.js" type="text/javascript"></script>
<script src="Js/pay.js" type="text/javascript"></script>
<script>
    getPayInfo();

    var g_paymethod = 'zfb';
    function selectPayMethod(flag) {
        g_paymethod = flag;
        if (flag == 'zfb') {
            document.getElementById("input_zfb").className = "Chosen";
            document.getElementById("input_ye").className = "Chosen2";
        } else if (flag == 'ye') {
            document.getElementById("input_zfb").className = "Chosen2";
            document.getElementById("input_ye").className = "Chosen";
        }
    }

    function showmoney() {
        $.ajax({
            type: "post",
            url: "/ServiceInterface/MyBankAndMoney.ashx",
            data: { flag: "myaccount" },
            dataType: "text",
            async: true,
            success: function (data) {
                //alert(data);
                $("#font_ye").html(data.split('|')[0]);
            }
        });
    }
    showmoney();




    function toPay() {
        var orderId = getQueryString('orderId');
        if (g_paymethod == "zfb") {
            location.href = "../PayInterface/alipay.wap.create.direct.pay.by.user-CSHARP-UTF-8/default.aspx?orderId=" + orderId;
        } else if (g_paymethod == "ye") {
            payByYE();
        }
    }

    function payByYE() {
        var orderId = getQueryString('orderId');
        //alert(orderId);
        $.ajax({
            type: "post",
            url: "/ServiceInterface/PayHandler.ashx",
            data: { flag: "paybyye",orderId:orderId },
            dataType: "text",
            async: true,
            success: function (data) {
                if (data == "1") {
                    alert("支付成功");
                    location.href = "MyOrder.html";
                } else {
                    alert(data);
                }
            }
        });
    }

</script>
